const mapValuesDeep = require('deepdash/mapValuesDeep');

let res = mapValuesDeep(
  {
    name: 'another thing',
    good: true,
    children: [
      { name: 'child thing 1', good: false },
      { name: 'child thing 2', good: true },
      { name: 'child thing 3', good: false },
      {
        name: 'something',
        good: false,
        children: [
          {
            name: 'something else',
            good: true,
            subItem: { name: 'sub-item', good: false },
            subItem2: { name: 'sub-item-2', good: true },
          },
        ],
      },
    ],
  },
  (v, key, parent, context) => {
    return v;
  },
  { leavesOnly: true, childrenPath: 'children[3].children' }
);

console.log('map mapValuesDeep: ', res);
